package day05;

import java.util.*;


/**
 * @author tongchen
 * @create 2022-11-24 22:46
 */
public class Day05_01 {
    public static void main(String[] args) {
        //测试输入
        Scanner scan=new Scanner(System.in);
        String str1=scan.nextLine();
        String str2=scan.nextLine();
            //定义计数器
            int count=0;

            //找插入位置
            for(int i=0;i<str1.length();++i){
                //建立stringbuilder
                StringBuilder sb = new StringBuilder();
                sb.append(str1.substring(0,i));
                sb.append(str2);
                sb.append(str1.substring(i,str1.length()));
                //进行转化维数组
                String string = sb.toString();
                //循环比较
                int begin=0;
                int end=string.length()-1;
                while(begin<=end){
                    if(string.charAt(begin)!=string.charAt(end)){
                        break;
                    }
                    begin++;
                    end--;
                }
                //最后判断
                if(begin>end){
                    count++;
                }
            }
        System.out.println(count);

    }
}
